package com.ta.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ta.gulimall.common.utils.system.PageUtils;
import com.ta.gulimall.ware.view.entity.PurchaseDetailEntity;
import com.ta.gulimall.ware.view.entity.WareSkuEntity;
import com.ta.gulimall.ware.view.vo.LockStoreRespVo;
import com.ta.gulimall.ware.view.vo.LockStoreVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author tuao
 * @email tuaoo@gmail.com
 * @date 2022-10-29 10:38:36
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    /**
     *sku商品库存
     * @param params
     * @return
     */
    PageUtils pageWareSkus(Map<String, Object> params);

    /**
     * 增加库存
     * @param purchaseDetail
     */
    void addWareSku(PurchaseDetailEntity purchaseDetail);

    /**
     * 查询skuId下的库存数
     *
     * @param skuIds
     * @return
     */
    Map<Long, Long> mapSkuWare(List<Long> skuIds);

    /**
     * 锁定库存
     * @param lockStoreVo
     * @return
     */
    LockStoreRespVo lockStore(LockStoreVo lockStoreVo);

    /**
     * 解锁库存
     * @param lockStoreRespVo
     */
    void unlockStore(LockStoreRespVo lockStoreRespVo);
}

